# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from typing import Union
from fastapi import Query
from pydantic import BaseModel, Field


class VideoRecordSearchIn(BaseModel):
    """ 视频记录搜索参数 """
    page_no: int = Query(default=1, gt=0, description="当前页码")
    page_size: int = Query(default=15, gt=0, le=200, description="每页条数")
    type: Union[str, None] = Query(default=None, description="绘图类型: [text2video,img2video]")
    prompt: Union[str, None] = Query(default=None, description="提示词")
    user_sn: Union[str, None] = Query(default=None, description="用户编号")
    status: Union[int, str, None] = Query(default=None, description="生成状态: [0=等待中,1=执行中,2=成功,3=失败]")
    start_time: Union[str, None] = Query(default=None, description="开始时间")
    end_time: Union[str, None] = Query(default=None, description="结束时间")


class VideoRecordDeleteIn(BaseModel):
    """ 视频记录删除参数 """
    id: int = Field(..., gt=0, description="ID")
    reason: str = Field(default="", description="原因描述")


"""--------------- Separator ---------------"""


class VideoRecordVo(BaseModel):
    """ 适配记录列表Vo """
    id: int = Field(description="ID")
    code: str = Field(description="编号")
    type: str = Field(description="类型: [text2video, image2video]")
    engine: str = Field(description="视频引擎")
    channel: str = Field(description="模型渠道")
    model: str = Field(description="模型名称")
    prompt: str = Field(description="视频描述")
    scale: str = Field(description="视频比例")
    image_url: str = Field(description="开始图片")
    image_end_url: str = Field(description="结束图片")
    video_url: str = Field(description="视频地址")
    fail_reason: str = Field(description="失败原因")
    use_points: int = Field(description="消耗积分")
    status: int = Field(description="生成状态: [0=等待中, 1=执行中, 2=成功, 3=失败]")
    is_free: int = Field(description="会员免费: [0=否, 1=是]")
    create_time: str = Field(description="创建时间")
    user: dict = Field(description="用户信息")
